<?php
    // website main header (logo and navigation)
    include("header.php");

    // classes and objects to be used on this page
    include_once(UCM_PATH . '/UCAddProduct.php');
    include_once(UCM_PATH . '/UCEditProduct.php');
    include_once(UCM_PATH . '/UCDeleteProduct.php');

    // navigation specific to the components page
    include_once(VIEW_PATH . '/Navigation_Products.php');
?>

<script type="text/javascript" src="script/ProductScript.js">
</script>

<div id="page-body">

<?php
    $view = $_REQUEST['view'];
    if ($view == "new")
    {
        include_once(VIEW_PATH . "/AddProductView.php");
    }
    else if ($view == "edit")
    {
        include_once(VIEW_PATH . "/EditProductView.php");
    }
    else if ($view == "delete")
    {
        include_once(VIEW_PATH . "/DeleteProductView.php");
    }

    $action = $_REQUEST['action'];
    if ($action == "add")
    {
        $ucAdd = new UCAddProduct();
        $ucAdd->run();
    }
    else if ($action == "edit")
    {
        $ucEdit = new UCEditProduct();
        $ucEdit->run();
    }
    else if ($action == "delete")
    {
        $ucDelete = new UCDeleteProduct();
        $ucDelete->run();
    }    
?>

</div>

<?php
	include("footer.php");
?>